// The Vue build version to load with the `import` command
// (runtime-only or standalone) has been set in webpack.base.conf with an alias.

import Vue from 'vue'
// 导入组件库
import ElementUI from 'element-ui';
// 导入组件相关样式
import 'element-ui/lib/theme-chalk/index.css';
import axios from 'axios'
import App from './App'
import router from './router'
//引入富文本编辑器
import VueQuillEditor from 'vue-quill-editor'
import 'quill/dist/quill.core.css'
import 'quill/dist/quill.snow.css'
import 'quill/dist/quill.bubble.css'
import base from './base'
import message from './message'
import gloable from '../src/api/login/gloable.css'
//实时语音
import annyang from 'annyang';
Vue.prototype.$annyang = annyang;
//数据大屏
import dataV from '@jiaminghi/data-view'
import mavonEditor from 'mavon-editor'
import 'mavon-editor/dist/css/index.css'
Vue.use(dataV)
Vue.use(mavonEditor)

//注册全局
Vue.use(VueQuillEditor);
Vue.use(base);
Vue.use(message);
Vue.config.productionTip = false
//
//权限
Vue.directive('permission', {
  inserted: function (el, binding) {
    const permission = binding.value
    const userPermission = JSON.parse(localStorage.getItem('permissions'))
    for (let i = 0; i < userPermission.length; i++) {
      if (permission && permission === userPermission[i]) {
        return;
      }
    }
    el.parentNode.removeChild(el)
  }
})

Vue.prototype.$http = axios
// 配置 Vue 插件
Vue.use(ElementUI);
Vue.config.productionTip = false

/* eslint-disable no-new */
new Vue({
  el: '#app',
  router,
  components: {App},
  template: '<App/>'
})

